import { type RouteRecordRaw } from 'vue-router'

const Dashboard = () => import('../views/dashboard/index.vue')

import SiteLayout from '../layout/index.vue'

const NotFound = () => import('../views/not-found/index.vue')

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: SiteLayout,
    children: [
      {
        path: '/dashboard',
        component: Dashboard,
        meta: {
          title: '仪表盘',
        },
      },
    ],
    meta: {
      title: '首页',
      exclude: true, // 从侧边菜单中排除
    },
  },
  {
    path: '/personalOffice',
    component: SiteLayout,
    children: [
      {
        path: '/personalOffice/examineApprove',
        component: () => import('../views/personalOffice/examineApprove.vue'),
        meta: {
          title: '流程审批',
        },
      },
      {
        path: '/personalOffice/mail',
        component: () => import('../views/personalOffice/mail.vue'),
        meta: {
          title: '我的邮件',
        },
      },
      {
        path: '/personalOffice/plan',
        component: () => import('../views/personalOffice/plan.vue'),
        meta: {
          title: '我的计划',
        },
      },
      {
        path: '/personalOffice/schedule',
        component: () => import('../views/personalOffice/schedule.vue'),
        meta: {
          title: '我的日程',
        },
      },
      // {
      //   path: '/personalOffice/setUp',
      //   component: () => import('../views/personalOffice/setUp.vue'),
      //   meta: {
      //     title: '流程设置',
      //   },
      // },
    ],
    meta: {
      title: '个人办公',
      icon: 'Position',
    },
  },
  {
    path: '/basicInformation',
    component: SiteLayout,
    children: [
      {
        path: '/basicInformation/project',
        component: () => import('../views/basicInformation/project.vue'),
        meta: {
          title: '项目信息',
        },
      },
      {
        path: '/basicInformation/personnel',
        component: () => import('../views/basicInformation/personnel.vue'),
        meta: {
          title: '人员信息',
        },
      },
      {
        path: '/basicInformation/company',
        component: () => import('../views/basicInformation/company.vue'),
        meta: {
          title: '公司信息',
        },
      },
      {
        path: '/basicInformation/warehouse',
        component: () => import('../views/basicInformation/warehouse.vue'),
        meta: {
          title: '仓库信息',
        },
      },
      {
        path: '/basicInformation/material',
        component: () => import('../views/basicInformation/material.vue'),
        meta: {
          title: '材料信息',
        },
      },
      // {
      //   path: '/basicInformation/category',
      //   component: () => import('../views/basicInformation/category.vue'),
      //   meta: {
      //     title: '材料类别',
      //   },
      // },
      // {
      //   path: '/basicInformation/initialization',
      //   component: () => import('../views/basicInformation/initialization.vue'),
      //   meta: {
      //     title: ' 初始化',
      //   },
      // },
    ],
    meta: {
      title: '基本信息',
      icon: 'Folder',
    },
  },
  {
    path: '/warehousing',
    component: SiteLayout,
    children: [
      {
        path: '/warehousing/inspect',
        component: () => import('../views/warehousing/inspect.vue'),
        meta: {
          title: '入库材料校验',
        },
      },
      {
        path: '/warehousing/period',
        component: () => import('../views/warehousing/period.vue'),
        meta: {
          title: '期间入库查询',
        },
      },
      {
        path: '/warehousing/registration',
        component: () => import('../views/warehousing/registration.vue'),
        meta: {
          title: '入库登记',
        },
      },
      {
        path: '/warehousing/today',
        component: () => import('../views/warehousing/today.vue'),
        meta: {
          title: '今日入库查询',
        },
      },
    ],
    meta: {
      title: '入库管理',
      icon: 'Pointer',
    },
  },
  {
    path: '/project',
    component: SiteLayout,
    children: [
      {
        path: '/project/borrApplication',
        component: () => import('../views/project/borrApplication.vue'),
        meta: {
          title: '材料借用申请',
        },
      },
      {
        path: '/project/borrApproval',
        component: () => import('../views/project/borrApproval.vue'),
        meta: {
          title: '材料借用审批',
        },
      },
      {
        path: '/project/borrQuery',
        component: () => import('../views/project/borrQuery.vue'),
        meta: {
          title: '材料借用查询',
        },
      },
      {
        path: '/project/retQuery',
        component: () => import('../views/project/retQuery.vue'),
        meta: {
          title: '材料归还查询',
        },
      },
      {
        path: '/project/retRegistration',
        component: () => import('../views/project/retRegistration.vue'),
        meta: {
          title: '材料归还登记',
        },
      },
    ],
    meta: {
      title: '项目管理',
      icon: 'Phone',
    },
  },
  {
    path: '/material',
    component: SiteLayout,
    children: [
      {
        path: '/material/outRegistration',
        component: () => import('../views/material/outRegistration.vue'),
        meta: {
          title: '出库登记',
        },
      },
      {
        path: '/material/outQuery',
        component: () => import('../views/material/outQuery.vue'),
        meta: {
          title: '出库查询',
        },
      },

      {
        path: '/material/repQuery',
        component: () => import('../views/material/repQuery.vue'),
        meta: {
          title: '维修查询',
        },
      },
      {
        path: '/material/repRegistration',
        component: () => import('../views/material/repRegistration.vue'),
        meta: {
          title: '维修登记',
        },
      },
      {
        path: '/material/scrQuery',
        component: () => import('../views/material/scrQuery.vue'),
        meta: {
          title: '报废查询',
        },
      },
      {
        path: '/material/scrRegistration',
        component: () => import('../views/material/scrRegistration.vue'),
        meta: {
          title: '报废登记',
        },
      },
    ],
    meta: {
      title: '材料管理',
      icon: 'Cpu',
    },
  },
  {
    path: '/statistics',
    component: SiteLayout,
    children: [
      {
        path: '/statistics/notReturned',
        component: () => import('../views/statistics/notReturned.vue'),
        meta: {
          title: '未返还查询',
        },
      },
      {
        path: '/statistics/subdepot',
        component: () => import('../views/statistics/subdepot.vue'),
        meta: {
          title: '分仓库库存查询',
        },
      },
      {
        path: '/statistics/warehouse',
        component: () => import('../views/statistics/warehouse.vue'),
        meta: {
          title: '材料仓库查询',
        },
      },
    ],
    meta: {
      title: '统计查询',
      icon: 'Cellphone',
    },
  },

  {
    path: '/other',
    component: SiteLayout,
    children: [
      {
        path: '/other/invQuery',
        component: () => import('../views/other/invQuery.vue'),
        meta: {
          title: '库存查询',
        },
      },
      {
        path: '/other/matInformation ',
        component: () => import('../views/other/matInformation .vue'),
        meta: {
          title: ' 其他材料信息',
        },
      },
      {
        path: '/other/matOutbound',
        component: () => import('../views/other/matOutbound.vue'),
        meta: {
          title: '其他材料出库',
        },
      },
      {
        path: '/other/matWarehousing',
        component: () => import('../views/other/matWarehousing.vue'),
        meta: {
          title: '其他材料入库',
        },
      },
      {
        path: '/other/outQuery',
        component: () => import('../views/other/outQuery.vue'),
        meta: {
          title: '出库查询',
        },
      },
      {
        path: '/other/wareQuery',
        component: () => import('../views/other/wareQuery.vue'),
        meta: {
          title: ' 入库查询',
        },
      },
    ],
    meta: {
      title: '其他出入库',
      icon: 'Sort',
    },
  },
  {
    path: '/accounts',
    component: SiteLayout,
    children: [
      {
        path: '/accounts/list',
        component: () => import('../views/accounts/list.vue'),
        meta: {
          title: '用户列表',
        },
      },
      {
        path: '/accounts/admin',
        component: () => import('../views/accounts/admin.vue'),
        meta: {
          title: '角色设置',
        },
      },
    ],
    meta: {
      title: '用户管理',
      icon: 'User',
    },
  },

  {
    path: '/system',
    component: SiteLayout,
    children: [
      {
        path: '/system/dataBackup',
        component: () => import('../views/system/dataBackup.vue'),
        meta: {
          title: '数据备份',
        },
      },
      {
        path: '/system/loginLog',
        component: () => import('../views/system/loginLog.vue'),
        meta: {
          title: '登录日志',
        },
      },
      {
        path: '/system/sysSettings',
        component: () => import('../views/system/sysSettings.vue'),
        meta: {
          title: '系统设置',
        },
      },
    ],
    meta: {
      title: '系统设置',
      icon: 'Setting',
    },
  },

  {
    path: '/register',
    component: SiteLayout,
    children: [],
    meta: {
      exclude: true, // 从侧边菜单中排除
    },
  },
  {
    path: '/login',
    component: () => import('../views/login/index.vue'),
    meta: {
      exclude: true, // 从侧边菜单中排除
    },
  },

  {
    path: '/:pathMatch(.*)*',
    component: NotFound,
    meta: {
      exclude: true,
    },
  },
]
